using System.Collections.Generic;
using System.Threading.Tasks;
using Ant.Dto.PersonnelDto;
using Ant.EntityFrameworkCore.Model;

namespace Ant.DbServiceInterface
{
    public interface IPersonneDataService
    {
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="user">用户数据</param>
        /// <returns>是否成功</returns>
        bool AddUser(UserInfo user);
        /// <summary>
        /// 添加角色权限
        /// </summary>
        /// <param name="name">权限名称</param>
        /// <returns>是否成功</returns>
        bool AddRole(string name);
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <returns>是否成功</returns>
        bool DelUser(int userID);
        bool UpdateJoinStore(int storeID,int userID);
        bool ExitStore(int storeID, int userID);
        
        Task<bool> UpdateRoleAsync(RoleDto roleDto);
        Task<bool> UpdateUserRoleAsync(UpdateUserRoleDto updateUserRoleDto);
        Task<bool> UpdateUserNameAsync(UpdateUserNameDto updateUserNameDto);
        Task<bool> UpdateUserEmailAsync(UpdateUserNameDto updateUserEmailDto);
        Task<bool> ExistUser(string email,string pwd);
        Task<IEnumerable<Role>> GetRoleAsync();
        Task<IEnumerable<UserInfo>> GetUserAsync();
        Task<UserInfo> GetUserByEmailAsync(string email);
    }

}